<!--  -->
<template>
  <div class="">
    <van-nav-bar title="登陆" />
    <van-divider>推荐登录方式</van-divider>
    <div class="button-login" @click="showPopup">微信账号登录</div>
    <van-popup v-model="show">
      <div class="content">
        <div class="title center">微信手机号授权</div>
        <van-divider class="divider"> </van-divider>
        <div class="middle">
          <img src="../assets/women.png" width="29px" height="29px" alt="" />
          <div class="middle-title">21世纪房产</div>
        </div>
        <div class="middle-sec">
          <van-divider class="divider"> </van-divider>
          <div class="middle-sec-title">申请获取你微信绑定的手机号</div>
          <div class="middle-sec-value">156****2564</div>
        </div>
        <div class="bottom">
          <div class="button" @click="close">取消</div>
          <div class="button red" @click="next">确认授权</div>
        </div>
      </div>
    </van-popup>
    <van-popup v-model="shownext">
      <div class="content">
        <div class="middle-sec">
          <div class="title top10">请填写手机短信验证码</div>

          <div class="middle-sec-title">已发送到手机139****9811</div>
          <van-number-keyboard
            v-model="value"
            :show="showKeyboard"
            @blur="showKeyboard = false"
            class="zFindex"
          />
        </div>
        <van-password-input
          :value="value"
          :mask="false"
          :focused="showKeyboard"
          @focus="showKeyboard = true"
        />

        <div class="bottom">
          <div class="button" @click="close">取消</div>
          <div class="button red" @click="gocenter">确认</div>
        </div>
      </div>
    </van-popup>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      show: false,
      shownext: false,
      showKeyboard: false,
      value: "",
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    showPopup() {
      this.show = true;
    },
    close() {
      this.show = false;
      this.shownext = false;
    },
    next() {
      this.show = false;
      this.shownext = true;
    },
    gocenter() {
      this.shownext = false;
      this.$router.push('/center')
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped>
/* @import url(); 引入公共css类 */
.button-login {
  font-size: 17px;
  font-family: Source Han Sans SC;
  font-weight: 400;
  color: #ffffff;
  line-height: 50px;
  height: 50px;
  background: #e75c61;
  border-radius: 25px;
  text-align: center;
  margin: 10px 20px;
}
.content {
  width: 254px;
  height: 235px;
  border-radius: 8px;
}
.title {
  font-size: 16px;
  font-family: Source Han Sans SC;
  font-weight: 400;
  color: #333333;
  line-height: 41px;
}
.center {
  text-align: center;
}
.divider {
  margin: 0;
}
.middle {
  text-align: center;
  padding: 10px 0px;
}
.middle-title {
  font-size: 13px;
  font-family: Source Han Sans SC;
  font-weight: 400;
  color: #333333;
}
.middle-sec {
  margin: 0 20px;
}
.middle-sec-title {
  font-size: 13px;
  font-family: Source Han Sans SC;
  font-weight: 400;
  color: #666666;
  line-height: 33px;
  height: 33px;
}
.middle-sec-value {
  font-size: 13px;
  font-family: Source Han Sans SC;
  font-weight: 400;
  color: #333333;
  line-height: 13px;
  height: 13px;
}
.bottom {
  position: absolute;
  bottom: 0;
  margin-top: 25px;
}
.button {
  width: 125.5px;
  height: 50px;
  border-style: solid none none solid;
  border-width: 0.1px;
  display: inline-block;
  line-height: 50px;
  text-align: center;
  border-color: #e1e1e1;
}
.red {
  color: #e75c61;
}
.top10 {
  margin-top: 25px;
  line-height: 16px;
}
.zFindex {
  position: absolute;
  width: 254px;
  height: 100px;
  bottom: 0;
}
</style>
